<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      width: 500px;
      height: 300px;
      margin: 100px auto;
      border: 1px solid #000;
    }

    .son {
      width: 200px;
      height: 100px;
      background-color: pink;
      transition: all .5s;
    }

    /* 鼠标移入到父盒子，子盒子改变位置 */
    .father:hover .son {
      /* transform: translate(水平方向上的位移, 垂直方向上的位移); */

      /* transform: translate(100px, 50px); */

      transform: translate(100%, 50%);
      
      transform: translate(-100%, 50%);

      /* 只给出一个值表示x轴移动距离 */
      transform: translate(100px);

      transform:  translateY(100px);
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="son"></div>
  </div>
</body>
</html>